package com.ymatou.iapi.payment.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.ymatou.iapi.godmch.parameter.SetPayModeBean;
import com.ymatou.iapi.godmch.parameter.setShareTypeBean;
import com.ymatou.iapi.payment.parameter.QueryGodPayChannelBean;
import com.ymatou.iapi.payment.service.QueryGodPayChannelCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.PayGateWayCallService;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
/**
*神器支付通道查询（支付风控）
*FreeMaker Template自动生成代码
*/
@TestSuite
@Ignore
//码头神器站点拆分
public class Ts_QueryGodPayChannel{
	private static QueryGodPayChannelBean querygodpaychannelBean;
	private static QueryGodPayChannelCall querygodpaychannelCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("神器支付通道查询（支付风控）");
	}

	@Before
	public void caseUp() {
		querygodpaychannelBean=new QueryGodPayChannelBean();
		querygodpaychannelCall=new QueryGodPayChannelCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(querygodpaychannelCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_001() {
		Logger.start(true,"神器支付通道查询（支付风控）");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("wxsqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo_6002, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_002() {
		Logger.start(true,"神器支付通道查询（支付风控）带paytype");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("wxsqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6002");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo_6002, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_003() {
		Logger.start(true,"神器支付通道查询（支付风控）开通alipay-指定渠道6006");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			SetPayModeBean bean = GodmchManageCallService.initSetPayModeBean(mchId);
			bean.setAliPayMode(1);
			GodmchManageCallService.SetPayModeCall(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("wxsqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6006");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();		
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(2, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_004() {
		Logger.start(true,"神器支付通道查询（支付风控）开通alipay-不指定渠道");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			SetPayModeBean bean = GodmchManageCallService.initSetPayModeBean(mchId);
			bean.setAliPayMode(1);
			GodmchManageCallService.SetPayModeCall(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("wxsqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
//			querygodpaychannelBean.setPayType("6006");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()<=1) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(2, jas.size(), "验证数量");
//			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
//			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
//			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_005() {
		Logger.start(true,"神器支付通道查询（支付风控）开通alipay-指定渠道6000");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			setShareTypeBean bean=new setShareTypeBean();
			bean.setAliPayMode(0);
			bean.setDualMode(0);
			bean.setMchId(mchId);
			bean.setMchShareType(1);
			bean.setPayMode(1);
			bean.setMchSideBuy(1);
			GodmchManageCallService.setShareTypeV2Call(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("wxsqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6000");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_006() {
		Logger.start(true,"神器支付通道查询（支付风控）开通alipay-指定渠道6001");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			setShareTypeBean bean=new setShareTypeBean();
			bean.setAliPayMode(0);
			bean.setDualMode(0);
			bean.setMchId(mchId);
			bean.setMchShareType(1);
			bean.setPayMode(1);
			bean.setMchSideBuy(1);
			GodmchManageCallService.setShareTypeV2Call(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("h5sqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6001");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_007() {
		Logger.start(true,"神器支付通道查询（支付风控）不开通alipay-指定渠道6006");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("wxsqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6006");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(0, jas.size(), "验证数量");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_008() {
		Logger.start(true,"神器支付通道查询（支付风控）开通PayMode1-指定渠道6000");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			setShareTypeBean bean=new setShareTypeBean();
			bean.setAliPayMode(0);
			bean.setDualMode(0);
			bean.setMchId(mchId);
			bean.setMchShareType(1);
			bean.setPayMode(1);
			bean.setMchSideBuy(1);
			GodmchManageCallService.setShareTypeV2Call(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("wxsqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6000");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_009() {
		Logger.start(true,"神器支付通道查询（支付风控）开通定渠道6001-h5sqBuyer");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			setShareTypeBean bean=new setShareTypeBean();
			bean.setAliPayMode(0);
			bean.setDualMode(0);
			bean.setMchId(mchId);
			bean.setMchShareType(1);
			bean.setPayMode(1);
			bean.setMchSideBuy(1);
			GodmchManageCallService.setShareTypeV2Call(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("h5sqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6001");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_010() {
		Logger.start(true,"神器支付通道查询（支付风控）开通PayMode2-指定渠道6002-appname-h5sqBuyer");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			SetPayModeBean bean = GodmchManageCallService.initSetPayModeBean(mchId);
			bean.setAliPayMode(1);
			//1 飞界国际 2飞界国际电子商务 3 sft
			bean.setPayMode(2);
			GodmchManageCallService.SetPayModeCall(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("h5sqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6002");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo_6002, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_011() {
		Logger.start(true,"神器支付通道查询（支付风控）开通aliPayMode1-指定渠道6006-appname-h5sqBuyer");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			SetPayModeBean bean = GodmchManageCallService.initSetPayModeBean(mchId);
			bean.setAliPayMode(1);
			//1 飞界国际 2飞界国际电子商务 3 sft
			bean.setPayMode(2);
			GodmchManageCallService.SetPayModeCall(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("h5sqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6006");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(2, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	//废弃6103 20200320
	public void Tc_QueryGodPayChannel_012() {
		Logger.start(true,"神器支付通道查询（支付风控）带paytype-6103.HipoPay-微信app");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("appsqSeller");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6103");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	//废弃6107 20200320
	public void Tc_QueryGodPayChannel_013() {
		Logger.start(true,"神器支付通道查询（支付风控）开通alipay-6107.HipoPay-支付宝app");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			setShareTypeBean bean=new setShareTypeBean();
			bean.setAliPayMode(1);
			bean.setDualMode(0);
			bean.setMchId(mchId);
			bean.setMchShareType(1);
			bean.setPayMode(1);
			bean.setMchSideBuy(1);
			GodmchManageCallService.setShareTypeV2Call(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("appsqSeller");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6107");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(2, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_014() {
		Logger.start(true,"神器支付通道查询（支付风控）开通PayMode2-指定渠道6003-appname-h5sqBuyer");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			SetPayModeBean bean = GodmchManageCallService.initSetPayModeBean(mchId);
			bean.setAliPayMode(0);
			//1 飞界国际 2飞界国际电子商务 3 sft
			bean.setPayMode(4);
			GodmchManageCallService.SetPayModeCall(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("h5sqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6003");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo_6002, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
//			Logger.verifyEquals(expected, actual, Description)
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_015() {
		Logger.start(true,"神器支付通道查询指定渠道6011");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			SetPayModeBean bean = GodmchManageCallService.initSetPayModeBean(mchId);
			bean.setAliPayMode(1);
			GodmchManageCallService.SetPayModeCall(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("wxsqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6011");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()<=1) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdH5sqBuyerMerchantNo_6011, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_016() {
		Logger.start(true,"神器支付通道查询（支付风控）开通alipay和sft-不指定渠道h5sqBuyer");
		try {
			Integer mchId_channl = GodmchManageCallService.CreateSellerMch();
			setShareTypeBean bean=new setShareTypeBean();
			bean.setAliPayMode(1);
			bean.setDualMode(1);
			bean.setMchId(mchId_channl);
			bean.setMchShareType(2);
			bean.setPayMode(1);
			bean.setMchSideBuy(1);
			bean.setDomesticPayMode(1);
			GodmchManageCallService.setShareTypeV2Call(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("h5sqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId_channl);
			querygodpaychannelBean.setSellerId(mchId_channl);
//			querygodpaychannelBean.setPayType("6006");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()<=1) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(2, jas.size(), "验证数量");
//			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
//			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
//			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryGodPayChannel_017() {
		Logger.start(true,"神器支付通道查询（支付风控）-指定渠道6000或6001且查不到支付渠道返回默认");
		try {
			Integer mchId = GodmchManageCallService.CreateSellerMch();
			setShareTypeBean bean=new setShareTypeBean();
			bean.setAliPayMode(0);
			bean.setDualMode(0);
			bean.setMchId(mchId);
			bean.setMchShareType(1);
			bean.setPayMode(0);
			bean.setMchSideBuy(1);
			bean.setDomesticPayMode(1);
			GodmchManageCallService.setShareTypeV2Call(bean);
			Thread.sleep(2000);
			querygodpaychannelBean.setAppName("wxsqBuyer");
			querygodpaychannelBean.setRootSellerId(mchId);
			querygodpaychannelBean.setSellerId(mchId);
			querygodpaychannelBean.setPayType("6000");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			JsonArray jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			JsonObject ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
			
			querygodpaychannelBean.setPayType("6001");
			querygodpaychannelCall.setData(querygodpaychannelBean);
			querygodpaychannelCall.callService();			
			if(querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().size()==0) {
				Thread.sleep(3000);
				querygodpaychannelCall.callService();
			}
			 jas = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray();
			Logger.verifyEquals(1, jas.size(), "验证数量");
			 ja = querygodpaychannelCall.getJsonObject().get("Result").getAsJsonArray().get(0).getAsJsonObject();
			Logger.verifyEquals(PayGateWayCallService.GdDefMerchantNo, ja.get("MchNo").getAsString(), "验证MchNo");
			Logger.verifyEquals(1, ja.get("PayChanel").getAsInt(), "验证PayChanel");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}